import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, Index } from 'typeorm';

@Entity('shares')
export class Share {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ nullable: true })
  shareMessage: string;

  @Column({ default: true })
  isPublic: boolean;

  @Column({ default: 0 })
  viewCount: number;

  @CreateDateColumn()
  sharedAt: Date;

  @Column()
  userId: number;

  @Column()
  novelId: number;
}